1. Field of the Invention
The present invention relates to a circuit for detecting the ON/OFF states of switches in accordance with the presence/absence of AC signals input through the switches.
2. Description of the Related Art
Computer and controllers are used in various fields, e.g., used for controlling of plants, industrial production lines, and machines. In general, the computer and a controller have circuit for detecting the ON/OFF states of the switches. In this case, the switches include, for example, relays, sensors for performing the ON/OFF operations, and various contacts to input set values arranged on a control panel of the controller. Such detection circuits are roughly categorized into DC and AC types. The DC type detection circuit detects the ON/OFF states of the switches using a DC signal source, whereas the AC type detection circuit detects the ON/OFF states of the switches using an AC signal source.
A conventional AC type detection circuit will be described with reference to FIG. 1. Referring to FIG. 1, switches SW1 to SWn are the ones to be detected. Detection circuits Ki are respectively arranged for switches SWi (i=1 to n). Each detection circuit Ki comprises impedance 1 for controlling an input current, rectifier 2 for performing full-wave rectification of an input signal, photocoupler 3, integrating circuit 4, and hysteresis circuit 5.
An operation of a circuit shown in FIG. 1 will be described by exemplifying the operation of switch SW1 and detection circuit K1. When switch SW1 is turned on, an AC voltage is applied from AC signal source (e.g., commercial power source) 9 to input terminal IN1. Voltage e1 applied to input terminal IN1 is rectified by rectifier 2. Output current i1 from rectifier 2 is supplied to photocoupler 3. FIG. 2A shows the relationship between current i1 and voltage e1. When a level of current i1 is higher than ON-current level Ith of photocoupler 3, photocoupler 3 is turned on. When a level of current i1 is lower than ON-current level Ith, photocoupler 3 is turned off. For this reason, as the output voltage from signal source 9 varies, photocoupler 3 is repeatedly turned on and off, as shown in FIG. 2B. An output signal from photocoupler 3 is supplied to integrating circuit 4 and is integrated thereby, as shown in FIG. 2C. When the ON state of switch SW1 is held over a given period of time, and an output voltage from integrating circuit 4 exceeds threshold level Vth, hysteresis circuit 5 outputs high-level signal S1, as shown in FIG. 2D. A CPU (not shown) receives high-level signal S1 and determines that switch SW1 is turned on.
The circuit shown in FIG. 1 has the following drawbacks. (1) The ON and OFF periods of photocoupler 3 vary depending on the magnitude of an output voltage from signal source 9. As a result, the time from when the switch is actually turned on until voltage e2 exceeds threshold level Vth varies in each circuit. Therefore, a complicated adjustment circuit is required for the system. (2) In the circuit in FIG. 1, a detection circuit is required for every switch. For this reason, the number of detection circuits is increased with a corresponding increase in the number of switches to be detected, thereby imposing limitations in the system in terms of packing density, cost, and power consumption.